﻿<div>
    <button class="btn btn-primary waves-effect" ng-click="add()"><span class="glyphicon glyphicon-plus"></span></button>
    <div class="form-inline pull-right">
        <button class="btn btn-info waves-effect" ng-click="list.GetPageData(paginationConf.currentPage, paginationConf.itemsPerPage);">
            <span class="glyphicon glyphicon-refresh"></span>
        </button>
        <div class="input-group">
            <span class="input-group-addon">全局搜索：</span>
            <div class="fg-line">
                <input type="text" class="form-control" ng-change="search(kw)" ng-model="kw" placeholder="全局搜索" />
            </div>
        </div>
    </div>
    <table ng-table="list.tableParams" class="table table-bordered table-hover table-condensed editable-table listTable" ng-form="list.tableForm" disable-filter="list.isAdding" tracked-table="list.tableTracker">
        <colgroup>
            <col width="10%" />
            <col width="15%" />
            <col width="15%" />
            <col width="15%" />
            <col width="5%" />
            <col width="5%" />
            <col width="25%" />
            <col width="10%" />
        </colgroup>
        <tr ng-repeat="row in $data" ng-form="rowForm" tracked-table-row="row" ng-class="{'text-danger':row.Preset}">
            <td title="'子系统名字'" filter="{AppName: 'text'}" sortable="'AppName'">
                {{row.AppName}}
            </td>
            <td title="'域名'" filter="{Domain: 'text'}">
                {{row.Domain}}
            </td>
            <td title="'AppId'" filter="{AppId: 'text'}">
                {{row.AppId}}
            </td>
            <td title="'AppSecret'" filter="{AppSecret: 'number'}">
                {{row.AppSecret}}
            </td>
            <td title="'可用'">
                <label class="el-switch">
                    <input type="checkbox" name="switch" ng-model="row.Available" ng-disabled="row.Preset">
                    <span class="el-switch-style" ng-click="toggle(row)"></span>
                </label>
            </td>
            <td title="'预置'">
                <label class="el-checkbox">
                    <input type="checkbox" name="check" ng-model="row.Preset" disabled="disabled">
                    <span class="el-checkbox-style"></span>
                </label>
            </td>
            <td title="'权限配置'">
                <div class="btn-group">
                    <a class="btn btn-danger btn-sm waves-effect" ng-href="#/apps/user/{{row.Id}}">
                        用户
                    </a>
                    <a class="btn btn-info btn-sm waves-effect" ng-href="#/apps/group/{{row.Id}}">
                        用户组
                    </a>
                    <a class="btn btn-primary btn-sm waves-effect" ng-href="#/apps/role/{{row.Id}}">
                        角色
                    </a>
                    <a class="btn btn-success btn-sm waves-effect" ng-href="#/apps/permission/{{row.Id}}">
                        权限
                    </a>
                    <a class="btn btn-danger btn-sm waves-effect" ng-href="#/access?appid={{row.AppId}}">
                        访问控制
                    </a>
                    <a class="btn btn-info btn-sm waves-effect" ng-href="#/menu?appid={{row.AppId}}">
                        菜单
                    </a>
                </div>
            </td>
            <td title="'操作管理'">
                <a class="btn btn-info btn-sm waves-effect" ng-href="#/apps/details/{{row.Id}}">
                    详情
                </a>
                <div class="btn-group" ng-if="!row.Preset">
                    <button class="btn btn-info btn-sm waves-effect" ng-click="list.edit(row)" ng-if="!row.Preset">
                        <i class="icon-pencil"></i>
                    </button>
                    <button class="btn btn-danger btn-sm waves-effect" ng-click="list.del(row)" ng-if="!row.Preset">
                        <i class="icon-cross"></i>
                    </button>
                </div>
            </td>
        </tr>
    </table>
    <tm-pagination conf="paginationConf"></tm-pagination>
</div>